import CustomRouterView from './components/custom-router-view.vue'
import NavLeft from '@/components/nav-left.vue'
import MainTop from '@/components/main-top.vue'
import { useComp } from '@/hooks'
import { watch } from 'vue'
import router from '@/router'
import { commonBus } from '@/events/index'
import './App.scss'
export const App = useComp(() => {
  watch(() => router.currentRoute.value.fullPath, () => {
    window.document.title = `${router.currentRoute.value.meta.title || '工作台'}`
    commonBus.emit(commonBus.CHANGE_ROUTE, router.currentRoute.value)
  })
  return () => (
    <div class={'base-app-view'}>
      <div class={'top-view'}></div>
      <div class={'content-view'}>
        <div class={'left'}><NavLeft/></div>
        <div class={'center'}>
          <div class={'cnenter-top'}><MainTop/></div>
          <div class={'cneter-main'}>
            <CustomRouterView/>
          </div>
        </div>
        <div class={'right'}></div>
      </div>
      <div class={'bottom-view'}></div>
      <div class={'seat-view'}></div>
    </div>
  )
})
export default App
